{include file="public/head"/}
<link rel="stylesheet" href="__ADMIN__/css/style.css">
<script src='__ADMIN__/js/jquery-1.11.0.min.js' ></script>
{js href='/static/kindeditor/NKeditor-all-min.js' /}
{js href='/static/kindeditor/libs/JDialog/JDialog.min.js' /}
<link rel="stylesheet" href="/static/wangEditor/css/wangEditor.min.css">
<script type="text/javascript" src="/static/wangEditor/js/wangEditor.min.js"></script>
{js href='/static/ueditor/ueditor.config.js' /}
{js href='/static/ueditor/ueditor.all.min.js' /}
{include file="public/foot"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">{if $info}编辑{else /}添加{/if}内容</div>
                <div class="layui-card-body" pad15>
                    <form class="layui-form" wid100 lay-filter="">
                        {if condition="isset($info['id'])"}
                        <input type="hidden" name="id" value="{$info.id}">
                        {/if}
                        {volist name="fields" id="r"}
                        {if condition="!empty($r['status'])"}
                        <div class="layui-form-item">
                            <label class="layui-form-label">{$r.name}</label>
                            {:getForm($form,$r,input($r.field))}
                        </div>
                        {/if}
                        {/volist}
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn" lay-submit lay-filter="sub-btn">确认保存</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var url= "{:url('index',['catid'=>input('catid')])}";
    {if $info}
        var subUrl= "{:url('update')}";
    {else /}
        var subUrl= "{:url('insert')}";
    {/if}
    layui.config({
        base: '__LAYADMIN__/',
        version: true
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','colorpicker','content'],function(){
        var  colorpicker = layui.colorpicker,$= layui.$;
        var color = $('#style_color').val();
        /*if(!color){
            $('#style_color').val("#000000");
        }*/
        colorpicker.render({
            elem: '#color'
            ,color:color?color:'' //设置默认色
            ,alpha: true
            ,format: 'rgb'
            ,done: function(color){
                $('#style_color').val(color);
            }
        });
    });
</script>
</body>
</html>